def main():
    a = {"January":1, "February":2, "May":5}
    # 这一行有2种写法
    # c = sorted(b, key=lambda x:x[1], reverse=True)
    # c = sorted(b, key=itemgetter(1), reverse=True)

    b = bubbleSort(a)
    for i in b:
        print(i[0])


def bubbleSort(d: dict):
    nums = list(d.items())
    for i in range(len(nums)-1):    # 这个循环负责设置冒泡排序进行的次数
        for j in range(len(nums)-i-1):  # ｊ为列表下标
            if nums[j][1] < nums[j+1][1]:
                nums[j], nums[j+1] = nums[j+1], nums[j]
    return nums


if __name__ == "__main__":
    main()